package com.example.system.util;


public class TableServerResponse<T> {
    private Integer code;   //状态码
    private T data; //数据
    private Long count;  //数据总条数

    public static <T> TableServerResponse createSuccess(Integer code, T data, Long count) {
        return new TableServerResponse(code, data, count);
    }

    @Override
    public String toString() {
        return "TableServerResponse{" +
                "code=" + code +
                ", data=" + data +
                ", count=" + count +
                '}';
    }

    public TableServerResponse() {
    }

    public TableServerResponse(Integer code, T data, Long count) {
        this.code = code;
        this.data = data;
        this.count = count;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public Long getCount() {
        return count;
    }

    public void setCount(Long count) {
        this.count = count;
    }
}
